<template>
    <view class="container" :style="themeColor">
        <view class="box">
            <view class="logo">
                <image v-if="logo" class="logo-img" :src="easyGetImgUrl(logo)"></image>
            </view>
            <view class="welcome">您好，欢迎登录！</view>
            <view class="h5-box">
                <view class="card-group">
                    <card-cell-input :showLabel="false" ref="userName" :value="userName" showIcon :inputType="'text'"
                        label="/static/icon/icon_login_user.png" placeholder="请输入您的手机号"></card-cell-input>
                </view>
                <view class="card-group">
                    <card-cell-input v-if="isPwdType" :showLabel="false" showIcon ref="password" :value="password"
                        label="/static/icon/icon_login_pwd.png" :inputType="'password'" placeholder="请输入登录密码">
                    </card-cell-input>
                    <view class="card-group-cell" v-else>
                        <input class="input" type="number" v-model="code" placeholder="请输入短信验证码" />
                        <view class="btn-get-code">
                            <button class="btn" :disabled="disabled" @click="getCode"
                                :class="!disabled ? 'btn-success-hollow' : 'btn-fail-hollow'">
                                {{ countdown }}<text v-show="timestatus">秒重获</text>
                            </button>
                        </view>
                    </view>
                </view>
                <view class="link-box" v-if="(isSms && smsNO) || (isSms && isPwdType && smsNO)">
                    <text class="change-type" v-if="isSms && smsNO" @click="isPwdType = !isPwdType">{{
                        isPwdType ? "验证码登录" : "密码登录"
                    }}</text>
                    <text class="forget-pwd" v-if="isSms && isPwdType && smsNO"
                        @click="easyGoTo('/pages/login/reset')">忘记密码</text>
                </view>
                <view class="agreement" v-if="getAppSet().agreement">
                    <label class="agrlabel" @click="selectFn(agreementchecked)">
                        <iconsfont customIcons="icon-yuanquan" :color="$store.state.themeColor" size="32"
                            v-show="!agreementchecked"></iconsfont>
                        <iconsfont customIcons="icon-xuanzhong1" :color="$store.state.themeColor" size="32"
                            v-show="agreementchecked"></iconsfont>
                    </label>
                    <view class="color-dark" @click="selectFn(agreementchecked)">登录注册表示您已阅读并同意</view>
                    <view><text @click="agreement()">《用户协议》</text>和<text @click="privacy()">《隐私政策》</text></view>
                </view>
                <button class="btn btn-success btn-save" @click="loginByService">立即登录</button>
                <!-- #ifdef MP -->
                <view class="weixinLogin" v-if="canRegister && getAppSet().wechatAuthorization">
                    <view v-if="getAppSet().agreement">
                        <button class="btn btn-tel btn-save" v-show="!agreementchecked"
                            @click="noAgreement()">手机号快捷登录</button>
                        <button class="btn btn-tel btn-save" v-show="agreementchecked" open-type="getPhoneNumber"
                            @getphonenumber="decryptPhoneNumber">
                            手机号快捷登录
                        </button>
                    </view>
                    <view v-else>
                        <button class="btn btn-tel btn-save" open-type="getPhoneNumber"
                            @getphonenumber="decryptPhoneNumber">手机号快捷登录</button>
                    </view>
                </view>
                <!-- #endif -->
                <view :class="webInfo.IsVisitor && (!token || token == '')
                    ? 'login-bottom'
                    : 'login-bottom login-bottom-center'
                    " v-if="canRegister">
                    <view class="register-tip" @click="easyGoTo('/pages/login/register')">
                        <text>还没账号？点击</text><text class="link-text">注册</text>
                    </view>

                    <view class="tourist" v-if="webInfo.IsVisitor && (!token || token == '')" @click="touristFn">
                        <view class="yuan">
                            <iconsfont customIcons="icon-zuji" color="#fff" size="26"></iconsfont>
                        </view>游客登录
                    </view>
                </view>

                <view class="login-bottom" v-else style="justify-content: center">
                    <view class="tourist" v-if="webInfo.IsVisitor && (!token || token == '')" @click="touristFn">
                        <view class="yuan">
                            <iconsfont customIcons="icon-zuji" color="#fff" size="26"></iconsfont>
                        </view>游客登录
                    </view>
                </view>
            </view>
            <view class="register-tip" style="padding-top: 48rpx;text-align: center" v-if="getAppSet().h5TokenLogin"
                @click="h5KeyLogin">
                <text class="link-text">快捷登录</text>
            </view>
            <!-- #ifdef MP -->
            <view class="login-wx" v-if="false">
                <button class="btn btn-success btn-save" @click="bindGetUserInfo">手机号快捷登录</button>
            </view>
            <!-- #endif -->
        </view>

        <!-- <image class="loginBg" :src="easyGetImgUrl(loginBg)" v-if="loginBg" mode="aspectFill"></image> -->

        <web-view class="webView" v-if="isShow" ref="webView" :src="url">
            <cover-view class="webView-mark" v-if="showNav"> </cover-view>
        </web-view>
        <privacy-agreement></privacy-agreement>
        <!--#ifdef APP-->
        <view class="bei-an" v-if="webInfo.AppIcpNo">{{ webInfo.AppIcpNo }}</view>
        <!--#endif-->
        <!--#ifndef APP-->
        <view class="bei-an" v-if="webInfo.MiniAppIcpNo">{{ webInfo.MiniAppIcpNo }}</view>
        <!--#endif-->
    </view>
</template>

<script>
import { mapMutations, mapState } from "vuex"
import { getProductDisplay, getInitWebInfo, getInitWebInfoUp, getUserInfo } from "@/utils/appInit.js"
import { getDomain } from "@/utils/appUrls.js"
import cardCellInput from "@/components/common/cell/card-cell-input.vue"
import privacyAgreement from "@/components/privacy-agreement/privacy-agreement.vue"
import storage from "@/uni-sub-base/utils/storage.js"
import { getUserCarList } from "@/utils/cartUtil.js"
import config from "@/config/config.js"
import { mobileLogin } from "@/service/api/user.js"
import { UserLogin, QuickLogin, SendSmsNoVerifyCode, GetSms, GetLoginWay, judgeIsExist, GetMemberGradeInfo, GetBindingInfo } from "@/service/api/member.js"
// import {
// 	getMiniProgramOpenId
// } from "@/uni-sub-base/service/api/open.js"
import { registerByWeixin, Token } from "@/service/api/authorize.js"
import { getMiniProgramOpenId, AESDecrypt, GetMiniAppPhone, MiniAppOAuthLogin } from "@/service/api/weChat.js"
import webViewUrl from "@/pages/micro/webViewUrl.js"
import { getPlatform } from "@/uni-sub-base/utils/platformUtil.js"
import { getCallBackUrl } from "@/utils/utils.js"
export default {
    components: {
        cardCellInput,
        privacyAgreement
    },
    data() {
        return {
            agreementchecked: false,
            sessionKey: "",
            openId: "",
            nickName: null,
            avatarUrl: null,
            userInfo: {},
            canIUse: uni.canIUse("button.open-type.getUserInfo"),
            canIGetUserProfile: false,

            isPwdType: true,
            logo: "",
            loginBg: "",
            isShow: false,
            url: "",
            showNav: false,
            canRegister: false,
            code: "",
            isSms: false,
            smsNO: false,
            timestatus: false,
            disabled: false,
            countdown: "获取验证码",
            phoneCode: "",
            telcode: "", // 绑定手机号需要的code
            phone: "",
            token: "",
            webInfo: {},
            userName: "",
            password: "",
        }
    },
    onLoad(e) {
        var _this = this
        // let domain = getDomain()
        // getInitWebInfo(domain, this)
        //#ifdef MP
        if (uni.getUserProfile) {
            this.canIGetUserProfile = true
        }
        //#endif
        setTimeout(() => {
            this.showNav = true
            this.$forceUpdate()
        }, 300)

    },
    mounted() {
        this.getWebInfo()
        //#ifdef MP
        wx.getSetting({
            success: (res) => {
                if (res.authSetting["scope.userInfo"] === true) {
                    // 成功授权
                    // 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框
                } else if (res.authSetting["scope.userInfo"] === false) {
                    // 授权弹窗被拒绝
                    wx.openSetting({
                        success: (res) => { },
                        fail: (res) => {
                            console.log(res)
                        },
                    })
                } else {
                    // 没有弹出过授权弹窗
                }
            },
        })
        //#endif
        this.getsms()
        this.getloginWay()
        this.wxlogin()
        this.token = storage.getCache("token")
        this.$nextTick(() => {
            this.userName = storage.getCache('userName')
            this.password = storage.getCache('password')
        })

    },
    onShow() {
    },
    methods: {
        ...mapMutations(["SET_AUTH"]),
        getsms() {
            GetSms().then((res) => {
                if (res.State == 1) {
                    this.isSms = true
                } else {
                    this.isSms = false
                }
            })
        },
        getloginWay() {
            GetLoginWay().then((res) => {
                if (res.State == 1) {
                    this.smsNO = true
                } else {
                    this.smsNO = false
                }
            })
        },
        noAgreement() {
            if (!this.agreementchecked && this.getAppSet().agreement == true) {
                this.easyToast("请先同意《用户协议》和《隐私政策》")
                return
            }
        },
        selectFn(vaule) {
            this.agreementchecked = !vaule
        },
        agreement() {
            // this.easyGoTo("/pages/web/h5?url=" + encodeURIComponent(this.getAppSet().agreementUrl))
            this.easyGoTo("/pages/web/agreement?type=4")
        },
        privacy() {
            // this.easyGoTo("/pages/web/h5?url=" + encodeURIComponent(this.getAppSet().privacyUrl))
            this.easyGoTo("/pages/web/agreement?type=5")
        },
        getCode() {
            let userName = this.$refs.userName.getValue()
            var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
            var that = this
            if (userName == "") {
                this.easyToast("请输入手机号码")
                return false
            } else if (!myreg.test(userName)) {
                this.easyToast("请输入正确手机号码")
                return false
            } else {
                let path = "?tel=" + userName + "&validType=8"
                SendSmsNoVerifyCode(path)
                    .then((res) => {
                        that.disabled = true //禁用点击
                        if (res.State == 1) {
                            that.countdown = 60
                            that.timestatus = true
                            that.clear = setInterval(that.countDown, 1000)
                        } else {
                            this.easyToast(res.Msg)
                            that.disabled = false
                        }
                    })
                    .catch((err) => {
                        console.log(err)
                        that.disabled = false
                    })
            }
        },
        countDown() {
            var that = this
            if (!that.countdown) {
                that.disabled = false
                that.timestatus = false
                that.countdown = "获取验证码"
                clearInterval(that.clear)
            } else {
                --that.countdown
            }
        },
        loginByService() {
            let userName = this.$refs.userName.getValue()
            this.showLoginLoadding()
            if (!userName) {
                this.easyToast("请输入手机号")
                return false
            }
            if (userName) {
                let regMobile = /^1[3456789]\d{9}$/
                if (!regMobile.test(userName)) {
                    this.easyToast("请输入正确的手机号")
                    return false
                }
            }
            if (!this.agreementchecked && this.getAppSet().agreement == true) {
                this.easyToast("请先同意《用户协议》和《隐私政策》")
                return
            }
            if (this.isPwdType) {
                //密码登录
                let password = this.$refs.password.getValue()
                let param = {
                    userName: userName,
                    password: password,
                }
                // if (typeof plus !== 'undefined') {
                //     var uuid = plus.device.uuid; // 获取设备的UUID
                //     param.IMEI = uuid
                // }
                const uuidKey = 'device_uuid';
                let uuid = uni.getStorageSync(uuidKey);
                if (!uuid) {
                    // 如果没有UUID，则生成一个并存储
                    uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
                        var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
                        return v.toString(16);
                    });
                    uni.setStorageSync(uuidKey, uuid);
                }
                param.IMEI = uuid
                let path = "?userName=" + userName + "&password=" + password
                UserLogin(param).then(async (res) => {
                    if (res.State == 1) {
                        if (res.Data.State == 0) {
                            let token = res.Data.Token
                            this.goHome(token)
                            storage.setCache("userName", userName)
                            storage.setCache("password", password)
                            let isFromShare = storage.getCache("isFromShare")
                            if (isFromShare) {
                                getCallBackUrl()
                                    .then(navigationData => {

                                        console.log("navigationData", navigationData)
                                        // 根据返回的 navigationData 执行相应的页面跳转  
                                        switch (navigationData.mode) {
                                            case 'redirectTo':
                                                wx.redirectTo({ url: navigationData.url });
                                                break;
                                            case 'switchTab':
                                                wx.switchTab({ url: navigationData.url });
                                                break;
                                            case 'reLaunch':
                                                wx.reLaunch({ url: navigationData.url });
                                                break;
                                            case 'navigateTo':
                                                wx.navigateTo({ url: navigationData.url });
                                                break;
                                            default:
                                                // 如果 mode 不在预期范围内，可以执行默认操作或抛出错误  
                                                console.error('Unsupported navigation mode:', navigationData.mode);
                                                // 你可以在这里添加重定向到默认页面的逻辑  
                                                // wx.redirectTo({ url: '/pages/index/index' });  
                                                break;
                                        }
                                        setTimeout((e) => {
                                            storage.removeCache("isFromShare")
                                        }, 5000)

                                    })
                                    .catch(error => {
                                        // 当 getCallBackUrl() 失败时，执行此代码块  
                                        // 不需要跳转到原来页面时，给个默认页面  
                                        wx.redirectTo({ url: '/pages/index/index' });
                                    });
                            }
                        } else if (res.Data.State == 1) {
                            uni.hideLoading()
                            this.easyToast("您已提交注册申请，等待审核中")
                        } else {
                            uni.hideLoading()
                            this.easyToast(res.Data.StateName)
                        }

                    } else {
                        uni.hideLoading()
                        this.easyToast(res.Msg)
                    }
                })
            } else {
                //验证码登录
                if (this.code == "") {
                    this.easyToast("请输入验证码")
                    return false
                }
                let path = "?user_name=" + userName + "&valid_code=" + this.code + "&valid_type=8"
                QuickLogin(path).then((res) => {
                    if (res.State == 1) {
                        if (res.Data.State == 0) {
                            let token = res.Data.Token
                            this.goHome(token)
                        } else if (res.Data.State == 1) {
                            uni.hideLoading()
                            this.easyToast("您已提交注册申请，等待审核中")
                        } else {
                            uni.hideLoading()
                            this.easyToast(res.Data.StateName)
                        }
                    } else {
                        uni.hideLoading()
                        this.easyToast(res.Msg)
                    }
                })
            }
        },
        goHome(token) {
            this.SET_AUTH(token)
            //#ifdef APP-PLUS
            if (getPlatform() == "ios") {
                let webInfo = storage.getCache("webInfo")
                if (webInfo) {
                    this.url =
                        webInfo.WebDomain +
                        (webInfo.AppHomeIndex ? webInfo.AppHomeIndex : webViewUrl.url.home) +
                        "?uniToken=" +
                        token
                }
                this.isShow = false
                setTimeout((e) => {
                    this.getUserInfo()
                }, 2500)
                getUserCarList()
                getProductDisplay().then((res) => { })
            } else {
                this.isShow = false
                setTimeout((e) => {
                    this.getUserInfo()
                }, 4500)
                getUserCarList()
                getProductDisplay().then((res) => { })
            }
            //#endif
            //#ifndef APP-PLUS
            let webInfo = storage.getCache("webInfo")
            if (webInfo) {
                this.url =
                    webInfo.WebDomain +
                    (webInfo.AppHomeIndex ? webInfo.AppHomeIndex : webViewUrl.url.home) +
                    "?uniToken=" +
                    token
            }
            // this.isShow = true

            setTimeout((e) => {
                this.getUserInfo()
            }, 2500)
            getUserCarList()
            getProductDisplay().then((res) => { })
            //#endif
        },
        getUserInfo() {
            let url = "/pages/index/index"
            let isFromShare = storage.getCache("isFromShare")
            getUserInfo().then((res) => {
                uni.hideLoading()
                let webInfo = storage.getCache("webInfo")
                if (webInfo.IsForceBindingInfo) {
                    GetBindingInfo().then((res) => {
                        if (res.Data.InfoEditList.length > 0) {
                            uni.reLaunch({
                                url: "/pages_shop/packet/upgrade/information",
                            })
                        } else {
                            if (!isFromShare) {
                                setTimeout((e) => {
                                    uni.reLaunch({
                                        url: "/pages/index/index",
                                    })
                                }, 500)
                            }
                        }
                    })
                } else {
                    if (!isFromShare) {
                        setTimeout((e) => {
                            uni.reLaunch({
                                url: "/pages/index/index",
                            })
                        }, 500)
                    }
                }
            })
        },
        saveUserInfo(data) {
            storage.setCache("userInfo", data)
        },
        h5KeyLogin() {//h5返回token登录
            this.easyReLaunch("/pages/web/index")
        },
        //登录授权
        bindGetUserInfo(e) {
            var _this = this
            if (this.canIGetUserProfile) {
                //新版登录方式
                uni.getUserProfile({
                    desc: "登录",
                    success: (res) => {
                        _this.userInfo = res.userInfo
                        _this.saveUserInfo(res.userInfo)
                        try {
                            _this.login()
                        } catch (e) { }
                    },
                    fail: (res) => {
                        console.log(res)
                    },
                })
            } else {
                //旧版登录方式
                if (e.detail.userInfo) {
                    //用户按了允许授权按钮
                    _this.userInfo = e.detail.userInfo
                    _this.saveUserInfo(e.detail.userInfo)
                    try {
                        _this.login()
                    } catch (e) { }
                } else {
                    console.log("用户拒绝了授权")
                    //用户按了拒绝按钮
                }
            }
        },
        //登录
        login() {
            let that = this
            // 获取登录用户code
            uni.login({
                provider: "weixin",
                success: function (res) {
                    if (res.code) {
                        let code = res.code
                        that.getOpenApi(res)
                    } else {
                        uni.showToast({
                            title: "登录失败！",
                            duration: 2000,
                        })
                    }
                },
            })
        },
        showLoginLoadding() {
            uni.showLoading({
                title: "登录中",
            })
        },
        //微信登录接口
        getOpenApi(data) {
            this.showLoginLoadding()
            let webInfo = storage.getCache("webInfo")
            let param = {
                code: data.code,
                accId: webInfo.WxAccountId,
            }
            getMiniProgramOpenId(param).then((res) => {
                let data = JSON.parse(res)
                this.loginByApi(data)
            })
        },
        //微信登录接口
        loginByApi(data) {
            let param = {
                open_id: data.openid,
            }
            registerByWeixin(param).then((res) => {
                if (res.Data) {
                    this.goHome(res.Data)
                }
            })
        },
        getWebInfo() {
            let webInfo = storage.getCache("webInfo")
            console.log(webInfo, "ddd")
            if (webInfo) {
                this.logo = webInfo.Logo
                this.loginBg = webInfo.LoginBackgroud
                this.canRegister = webInfo.AllowRegister
            } else {
                setTimeout((e) => {
                    this.getWebInfo()
                    this.$forceUpdate()
                }, 1000)
            }
            this.webInfo = webInfo
        },
        disable() {
            if (this.$refs.userName && this.$refs.password) {
                let userName = this.$refs.userName.getValue()
                let password = this.$refs.password.getValue()
                return userName.trim() == "" || password.trim() == ""
            }
            return true
        },
        touristFn() {
            let token = storage.getCache("token")
            let webInfo = storage.getCache("webInfo")
            if (webInfo.IsVisitor && (!token || token == "")) {
                //有游客账号
                uni.reLaunch({
                    url: "/pages/index/index",
                })
            } else {
                this.easyToast("后台未开启游客模式")
            }
        },
        //小程序登录
        wxlogin() {
            let that = this
            // 获取登录用户code
            uni.login({
                provider: "weixin",
                success: function (res) {
                    if (res.code) {
                        let code = res.code
                        that.telcode = res.code
                        that.getwxOpenApi(res)
                    } else {
                        console.log("登录失败！" + res.errMsg)
                    }
                },
            })
        },
        //微信登录接口
        getwxOpenApi(data) {
            // this.showLoginLoadding()
            let webInfo = storage.getCache("webInfo")
            let param = {
                code: data.code,
                businessId: webInfo.BusinessId,
                accId: webInfo.WxAccountId,
            }
            let path = "?code=" + data.code
            getMiniProgramOpenId(param, path).then((res) => {
                if (res.Data) {
                    // this.loginByApi(res.Data)
                    let open_id = res.Data.OpenId
                    let union_id = res.Data.UnionId || ""
                    storage.setCache("openId", open_id)
                    storage.setCache("unionId", union_id)
                }
            })
        },
        //授权手机号
        decryptPhoneNumber(e) {
            let that = this
            // 参数e是绑定的授权方法自动传入过来的,
            //主要是为了拿到vi和encryptedData值从后台换取用户联系方式
            if ("getPhoneNumber:ok" != e.detail.errMsg) {
                let url = "/pages/login/loading"
                uni.reLaunch({
                    url: url,
                })
                return
            }
            let iv = e.detail.iv
            let encryptedData = e.detail.encryptedData
            let code = that.telcode
            that.phoneCode = e.detail.code
            //调用后台接口获取用户手机号码
            let path = "?code=" + e.detail.code
            GetMiniAppPhone(path).then((res) => {
                if (res.State == 1) {
                    that.phone = res.Data.Phone
                    that.judgeIsExist(that.phone)
                } else {
                    that.easyToast(res.Msg)
                }
            })
        },
        judgeIsExist(tel) {
            let that = this
            judgeIsExist(tel).then((res) => {
                if (res.State == 1) {
                    that.easyGoTo("/pages/login/register?phone=" + that.phone)
                } else {
                    if (res.Msg == "用户已存在") {
                        that.showLoginLoadding()
                        that.goLogin()
                    } else {
                        that.easyToast(res.Msg)
                    }
                }
            })
        },
        goLogin() {
            MiniAppOAuthLogin({ phoneCode: this.phoneCode }).then((res) => {
                if (res.State == 1) {
                    if (res.Data.State == 0) {
                        let token = res.Data.Token
                        this.goHome(token)
                    } else if (res.Data.State == 1) {
                        uni.hideLoading()
                        this.easyToast("您已提交注册申请，等待审核中")
                    } else {
                        uni.hideLoading()
                        this.easyToast(res.Data.StateName)
                    }
                } else {
                    uni.hideLoading()
                    this.easyToast(res.Msg)
                }
            })
        },
    },
}
</script>

<style lang="scss">
page {
    background: #fff;
}

.container {
    padding: 60rpx 60rpx 0;
}

.btn-save {
    margin-top: 48rpx;
    height: 88rpx;
    font-size: $font-size-36;
}

.logo {
    display: flex;
    justify-content: center;
    height: 140rpx;
    margin-top: 150rpx;

    .logo-img {
        width: 140rpx;
        height: 140rpx;
        border-radius: 40rpx;
        box-shadow: 0rpx 0rpx 30rpx rgba($color-black, 0.1);
    }
}

.h5-box {
    .link-box {
        display: flex;
        flex-direction: row;
        // height: 60rpx;
        justify-items: center;
        justify-content: space-between;

        .change-type {
            display: flex;
            color: #333333;
        }

        .forget-pwd {
            display: flex;
            justify-content: flex-end;
            color: #333333;
        }
    }

    .register-tip {
        display: flex;
        justify-content: center;

        text {
            font-size: 28rpx;
        }

        .link-text {
            color: $app-color-main;
        }
    }
}

.box {
    position: relative;
    z-index: 9;
}

.loginBg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    let: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.card-group {
    border-radius: 20rpx;
    background: #f5f6f7;
    border-radius: 49rpx;
    margin-bottom: 24rpx;
    margin-top: 8rpx;

    .card-group-cell {
        padding-top: 20rpx;
        padding-bottom: 20rpx;

        &:last-child {
            border-bottom: none;
        }
    }
}

.disable {
    opacity: 0.5;
    border: none;
}

.webView-mark {
    width: 100vw;
    height: 100vh;
    background: #fff;
    position: fixed;
    z-index: 999999999999;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
}

.card-group-cell {
    min-height: 55rpx;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: $app-page-padding $app-page-padding $app-page-padding 0;
    margin-left: $app-page-padding;
    border-bottom: solid 1rpx $uni-bg-color-grey;

    &:last-child {
        // border-bottom: 0;
    }

    .label {
        min-width: 180rpx;
    }

    .input {
        outline: none;
        border: none;
        width: 100%;
        display: flex;
        flex: 1;
        padding: 10rpx 0;
        font-size: $font-size-28;
    }

    .btn-get-code {
        display: flex;
        flex: 1;
        justify-content: flex-end;
    }
}

.btn {
    margin-right: 0;
}

.btn-fail-hollow {
    color: #999;
    border: solid 1rpx #999;
}

.agreement {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 48rpx -60rpx -18rpx -60rpx;

    .circle {
        width: 28rpx;
        height: 28rpx;
        border-radius: 50%;
        border: 1rpx solid #999;
        display: block;
        overflow: hidden;
    }

    .agrlabel {
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    view {
        font-size: 24rpx;

        text {
            color: $app-color-main !important;
        }
    }

    .color-dark {
        padding-left: 8rpx;
    }
}

.welcome {
    font-size: 40rpx;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin: 24rpx 0 40rpx 0;
}

.login-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40rpx;

    .tourist {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        color: #999;

        .yuan {
            width: 38rpx;
            height: 38rpx;
            background: #fdb52a;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 20rpx;
            margin-right: 16rpx;
        }
    }
}

.login-bottom-center {
    justify-content: center;
}

.weixinLogin {

    .yuan {
        width: 40rpx;
        height: 40rpx;
        background: #09bb07;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 20rpx;
        margin-right: 12rpx;
    }

    .btn-tel {
        color: #666;
        background: #fff;
        border: solid 1rpx #666;
        margin-top: 36rpx;
        font-size: $font-size-32;
    }
}

.bei-an {
    position: fixed;
    bottom: 24rpx;
    text-align: center;
    width: 100%;
    left: 0;
}
</style>
